#include "kstd.h"
#include "pic.h"

static int last_key = -1;

void keyboard_event(void)
{
  unsigned char i = inb(0x60);

  if ((i & 0b10000000) == 0)
    last_key = i & 0b01111111;

  outb(0x20, 0x20);
}

int getkey(void)
{
  return last_key;
}
